package nowCoder;

import java.util.Scanner;

/**
 * @Auther: zzx
 * @Date: 2024.02.24/2/25
 */
public class HJ64 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int[] l = new int[]{1,2,3,4};
        int[] x = l;
        int[] ll =  new int[]{n-3,n-2,n-1,n};
        int song = 1;
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c == 'U'){
                if (song == 1){
                    song = n;
                    x = ll;
                    continue;
                }
                song --;
                if (song >= x[0]){
                    continue;
                }
                for (int j = 0; j < 4; j++) {
                    x[j]--;
                }
            }else {
                if (song == n){
                    song = 1;
                    x = l;
                    continue;
                }
                song ++;
                if (song <= x[3]){
                    continue;
                }
                for (int j = 0; j < 4; j++) {
                    x[j]++;
                }
            }
        }
        for (int i = 0; i < 4; i++) {
            if (x[i]>0)
                System.out.print(x[i]+" ");
        }
        System.out.println(song);
    }
}
